package com.bwie.shop.remote.impl;

import com.bwie.common.domain.Contract;
import com.bwie.common.result.Result;
import com.bwie.shop.remote.ShopRemote;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class Fusing implements FallbackFactory<ShopRemote> {
    @Override
    public ShopRemote create(Throwable cause) {
        return new ShopRemote() {
            @Override
            public Result<List<Contract>> selectContractQuantity() {
                throw new RuntimeException("服务器维护中");
            }
        };
    }
}
